<meta charset=UTF-8 />
<!-- #set(PaginatedList<TinyOrderModel> proOrders) -->
<!--
		#set(
		pagerPrOrder = proOrders.pager,
		prOrdertotalResults = pagerPrOrder.getCountOfTotalResults(),
		prOrdertotalPages = pagerPrOrder.getCountOfTotalPages() * 1,
		prOrderpageSize = pagerPrOrder.pageSize,
		prOrderpageNo = pagerPrOrder.pageNo,
		prOrderprePageNo = pagerPrOrder.getPrevPageNo(),
		prOrdernextPageNo = pagerPrOrder.getNextPageNo()
		)
-->
<!--#if(proOrders)-->
<table class="table
 table-bordered table-hover table-condensed tb" style="text-align: center;">
	<tr>
		<td class="tb-small-chose"><input type="checkbox" id="prorder_control"></td>
		<td class="tb-common">下单编号</td>
		<td>会员名</td>
		<td class="tb-teacher">下单类型</td>
		<td class="tb-teacher">原金额(元)</td>
		<td class="tb-teacher">折扣</td>
		<td class="tb-teacher">实际金额(元)</td>
		<td class="tb-time">购买时间</td>
		<td class="tb-teacher">负责人</td>
	<tr>
		<!--#for(TinyOrderModel om : proOrders)-->
	<tr>
		<td>
			<input type="checkbox" name="prorder_${om.id}">
		</td>
		<td>${om.id}</td>
		<td>${om.buyerName}</td>
		<td>${om.buyType}</td>
		<td>${om.money}</td>
		<td>${om.discount}</td>
		<!-- #if(om.buyType == '退款') -->
			<td>-${om.actualMoney}</td>
		<!-- #else -->
			<td>${om.actualMoney}</td>
		<!-- #end -->
		<td>${om.buyTime}</td>
		<td>${om.officerName}</td>
	</tr>
	<!--#end-->
</table>


<div class="gzce-pagering">
		<ul class="pagination">
			<li><a href="javascript:void(0)" onclick="goToPage(1)">首页</a></li>
			<!-- #if(prOrderpageNo==1) -->
			<li class="disabled"><a href="javascript:void(0)">上一页</a></li>
			<!-- #else -->
			<li><a href="javascript:void(0)" onclick="goToProOrderPage('${prOrderprePageNo}')">上一页</a></li>
			<!-- #end -->
			<!-- #if(prOrderpageNo==prOrdertotalPages) -->
			<li class="disabled"><a href="javascript:void(0)">下一页</a></li>
			<!-- #else -->
			<li><a href="javascript:void(0)" onclick="goToProOrderPage('${prOrdernextPageNo}')">下一页</a></li>
			<!-- #end -->
			<li><a href="javascript:void(0)" onclick="goToProOrderPage('${prOrdertotalPages}')">尾页</a></li>
			<li><a>第<input id="txtPageProPNumber" value="${prOrderpageNo}" onkeyup="this.value=this.value.replace(/\D/g,'')" onblur="changeProOrderPage(this.value)" type="text" />页&nbsp;~&nbsp;共${prOrdertotalPages}&nbsp;页/${prOrdertotalResults}条
			</a></li>
		</ul>
</div>
<!-- #else -->
<div class="panel-body">没有符合条件的数据</div>
<!-- #end -->

<script type="text/javascript">
	function changeProOrderPage(value) {
		value = value * 1;
		var totalPages = '${prOrdertotalPages}';
		if (value > totalPages) {
			value = totalPages;
		} else if (value < 1) {
			value = 1;
		}
		$("#txtPageProPNumber").val(value);
		goToPage(value);
	}
	function goToProOrderPage(pageNo) {
		$("#hidPageProONo").val(pageNo);
		document.memberProductForm.submit();
	}
	
	//订单全选
	$("#prorder_control").click(function() {
		$("input[name^='prorder_']").prop("checked", $(this).prop("checked"));
	});
	
	
	//结清显示折扣
	$("#clearOrder").click(function() {
		var count = $("input[name^='prorder_']:checked").length;
		if(count > 1) {
			error("只能选择一个！");
			return;
		} else if(count < 1) {
			error("请选择一个账单！");
			return;
		}
		
		var id = "", idArr, ids = "";
		//获得所有选择的订单编号
		$("input[name^='prorder_']:checked").each(function() {
			id = $(this).attr("name");
			idArr = id.split("_");
			ids += idArr[1] + ",";
		});
		
		
		toggleClearOrderDiv();
	});
	
	
	
	
</script>